import AbsExpression from "../abstract/AbsExpression";
import MetaData from "../MetaData";

class ValueExpression extends AbsExpression {
    /** 预处理 */
    protected pretreatment: boolean = true;
    protected data: string;

    constructor(value: string | number, pretreatment: boolean = true, metaData: MetaData) {
        super();
        this.data = `"${value}"`;
        this.pretreatment = pretreatment;
        if (pretreatment) {
            metaData.parameter.push(value)
            this.data = "?";
        }
    }

    toLocaSql(): string {
        return this.data;
    }

    toSql(): string {
        return "";
    }

    first(): any {
    }

    get(): any {
    }
}

export = ValueExpression;